/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package emf.entity_relationship.model.entityrelationship.impl;

import emf.entity_relationship.model.entityrelationship.Attribute_Composite;
import emf.entity_relationship.model.entityrelationship.EntityrelationshipPackage;
import emf.entity_relationship.model.entityrelationship.TypeIdentifier;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Attribute Composite</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link emf.entity_relationship.model.entityrelationship.impl.Attribute_CompositeImpl#getName_at_composite <em>Name at composite</em>}</li>
 *   <li>{@link emf.entity_relationship.model.entityrelationship.impl.Attribute_CompositeImpl#getIdentifier_at_composite <em>Identifier at composite</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class Attribute_CompositeImpl extends EObjectImpl implements Attribute_Composite {
	/**
	 * The default value of the '{@link #getName_at_composite() <em>Name at composite</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName_at_composite()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_AT_COMPOSITE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName_at_composite() <em>Name at composite</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName_at_composite()
	 * @generated
	 * @ordered
	 */
	protected String name_at_composite = NAME_AT_COMPOSITE_EDEFAULT;

	/**
	 * The default value of the '{@link #getIdentifier_at_composite() <em>Identifier at composite</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getIdentifier_at_composite()
	 * @generated
	 * @ordered
	 */
	protected static final TypeIdentifier IDENTIFIER_AT_COMPOSITE_EDEFAULT = TypeIdentifier.NO_IDENTIFIER;

	/**
	 * The cached value of the '{@link #getIdentifier_at_composite() <em>Identifier at composite</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getIdentifier_at_composite()
	 * @generated
	 * @ordered
	 */
	protected TypeIdentifier identifier_at_composite = IDENTIFIER_AT_COMPOSITE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected Attribute_CompositeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return EntityrelationshipPackage.Literals.ATTRIBUTE_COMPOSITE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName_at_composite() {
		return name_at_composite;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName_at_composite(String newName_at_composite) {
		String oldName_at_composite = name_at_composite;
		name_at_composite = newName_at_composite;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__NAME_AT_COMPOSITE, oldName_at_composite, name_at_composite));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TypeIdentifier getIdentifier_at_composite() {
		return identifier_at_composite;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setIdentifier_at_composite(TypeIdentifier newIdentifier_at_composite) {
		TypeIdentifier oldIdentifier_at_composite = identifier_at_composite;
		identifier_at_composite = newIdentifier_at_composite == null ? IDENTIFIER_AT_COMPOSITE_EDEFAULT : newIdentifier_at_composite;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__IDENTIFIER_AT_COMPOSITE, oldIdentifier_at_composite, identifier_at_composite));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__NAME_AT_COMPOSITE:
				return getName_at_composite();
			case EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__IDENTIFIER_AT_COMPOSITE:
				return getIdentifier_at_composite();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__NAME_AT_COMPOSITE:
				setName_at_composite((String)newValue);
				return;
			case EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__IDENTIFIER_AT_COMPOSITE:
				setIdentifier_at_composite((TypeIdentifier)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__NAME_AT_COMPOSITE:
				setName_at_composite(NAME_AT_COMPOSITE_EDEFAULT);
				return;
			case EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__IDENTIFIER_AT_COMPOSITE:
				setIdentifier_at_composite(IDENTIFIER_AT_COMPOSITE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__NAME_AT_COMPOSITE:
				return NAME_AT_COMPOSITE_EDEFAULT == null ? name_at_composite != null : !NAME_AT_COMPOSITE_EDEFAULT.equals(name_at_composite);
			case EntityrelationshipPackage.ATTRIBUTE_COMPOSITE__IDENTIFIER_AT_COMPOSITE:
				return identifier_at_composite != IDENTIFIER_AT_COMPOSITE_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (name_at_composite: ");
		result.append(name_at_composite);
		result.append(", identifier_at_composite: ");
		result.append(identifier_at_composite);
		result.append(')');
		return result.toString();
	}

} //Attribute_CompositeImpl
